Page({
  data: {
    userInfo: {},
    _UrlGet_: wx.getStorageSync('img_url')
  },
  onShow() {
    this.setData({
      userInfo: getApp().globalData.userInfo
    })
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        selected: 4  //这个数字是当前页面在tabBar中list数组的索引
      })
    }
  },


  // 跳转到预约列表页面
  navigateToOrder: function () {
    wx.navigateTo({
      url: '/pages/bookingList/bookList'
    });
  },

  // 跳转到社团页面
  navigateToAddress: function () {
    wx.navigateTo({
      url: '/pages/myClubList/index'
    });
  },
  navigateToActivity: function () {
    wx.navigateTo({
      url: '/pages/myActivityList/index'
    });
  },
  navigateToLecture: function () {
    wx.navigateTo({
      url: '/pages/myLectureList/index'
    });
  },
  navigateToBooking: function () {
    wx.navigateTo({
      url: '/pages/myBookingList/index'
    });
  },
  navigateToVideo: function () {
    wx.navigateTo({
      url: '/pages/myVideo/index'
    });
  },
  logout() {
    wx.showModal({
      title: '提示',
      content: '确定要退出登录吗？',
      success(res) {
        if (res.confirm) {
          // 执行退出登录逻辑
          getApp().globalData.token = "";
          getApp().globalData.userInfo=""
          wx.removeStorageSync('token');
          wx.removeStorageSync('userInfo');
       
          wx.reLaunch({
            url: '/pages/login/login'
          });
        }
      }
    })
  }
});